| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

FunctionParameter.h
1 // FunctionParameter.h
3 //
5
6 namespace nkScripts
7 {
11 struct UserTypeHolder
12 {
13 nkMemory::String _userTypeName ;
14 void* _userData = nullptr ;
15 ScriptObjectView _objectRef ;
16 } ;
17 }
18
19 namespace nkScripts
20 {
24 struct FunctionParameter final
25 {
26 // Functions
30 FunctionParameter () noexcept ;
36 explicit FunctionParameter (bool val) noexcept ;
42 explicit FunctionParameter (int val) noexcept ;
48 explicit FunctionParameter (float val) noexcept ;
54 explicit FunctionParameter (double val) noexcept ;
60 FunctionParameter (const char* val) noexcept ;
66 FunctionParameter (nkMemory::StringView val) noexcept ;
74 FunctionParameter (void* val, nkMemory::StringView userTypeName, bool scriptOwner) noexcept ;
80 FunctionParameter (const ScriptObjectReference& scriptObjectReference) noexcept ;
86 FunctionParameter (const FunctionParameter& other) noexcept ;
92 FunctionParameter (FunctionParameter&& other) noexcept ;
96 ~FunctionParameter () ;
97
98 // Utilities
102 void prepareForInternalType () ;
106 void prepareForString () ;
110 void prepareForUserType () ;
114 void prepareForScriptObjectReference () ;
115
116 // Operators
122 FunctionParameter& operator= (const FunctionParameter& other) noexcept ;
128 FunctionParameter& operator= (FunctionParameter&& other) noexcept ;
129
130 // Arguments
134 union
135 {
136 bool _valBool ;
137 int _valInt ;
138 float _valFloat ;
139 double _valDouble ;
140 nkMemory::String _valString ;
141 UserTypeHolder _valUser ;
142 ScriptObjectReference _valScriptObject ;
143 } ;
144
145 FUNCTION_PARAMETER_TYPE _type ;
146
150 static FunctionParameter VOID ;
151 } ;
152 }
nkScripts
Encompasses all API of component NilkinsScripts.
Definition: Environment.h:7
nkScripts::FunctionParameter::prepareForScriptObjectReference
void prepareForScriptObjectReference()
nkScripts::FunctionParameter::VOID
static FunctionParameter VOID
Definition: FunctionParameter.h:150
nkScripts::FunctionParameter::FunctionParameter
FunctionParameter() noexcept
nkScripts::FunctionParameter
A function parameter, used within the stack of arguments.
Definition: FunctionParameter.h:25
nkScripts::ScriptObjectReference
A reference over an object in the scripting environment.
Definition: ScriptObjectReference.h:30
nkScripts::UserTypeHolder::_userData
void * _userData
The user data pointer attached.
Definition: FunctionParameter.h:14
nkScripts::FunctionParameter::_type
FUNCTION_PARAMETER_TYPE _type
The actual type of the variable held.
Definition: FunctionParameter.h:145
nkScripts::UserTypeHolder::_objectRef
ScriptObjectView _objectRef
If parameter is a USER_DATA, it will provide a view that can be converted to a reference if needed.
Definition: FunctionParameter.h:15
nkMemory::String
Class holding information about a string, with ownership over the data.
Definition: String.h:22
nkScripts::UserTypeHolder
Holds information about a user type parameter.
Definition: FunctionParameter.h:12
nkScripts::FunctionParameter::prepareForInternalType
void prepareForInternalType()
nkScripts::ScriptObjectView
A view over an object in the scripting environment.
Definition: ScriptObjectView.h:16
nkScripts::FunctionParameter::prepareForUserType
void prepareForUserType()
nkScripts::FUNCTION_PARAMETER_TYPE
FUNCTION_PARAMETER_TYPE
Describes a variable type.
Definition: FunctionParameterType.h:12
nkScripts::FunctionParameter::prepareForString
void prepareForString()
nkScripts::UserTypeHolder::_userTypeName
nkMemory::String _userTypeName
The user type name of the variable referenced.
Definition: FunctionParameter.h:13
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7